
<div ng-controller="SalesReturnCtrl">
	
<div ng-include="'/templates/paramsSelect.html'"></div>
	<div class="page-heading">
		<ul class="breadcrumb">
			<li><a href="javascript:;">报表管理</a></li>
			<li><a href="javascript:;">维修报表</a></li>
			<li class="active" ng-hide="menuName">销售回厂查询</li>
			<li class="active" ng-show="menuName" ng-bind="menuName"></li>
			<span style="margin-right:10px;"  class="btn btn-danger btn-xs pull-right btn-flag " ng-show="flag" ng-click="delFlag('/cost/cost/')"><i class="fa fa-times"></i> 删除 </span>
			<span style="margin-right:10px;"  class="btn btn-info btn-xs pull-right btn-flag " ng-click="addFlag('#/repair/salesreturn/')"><i class="fa fa-star"></i> 收藏 </span>
		
		</ul>
	</div>
	<!-- 页面头部  end-->

	<!--页面内容显示区域-->
	<div class="wrapper">


		<div class="row">
			<div class="col-sm-12">
				<!--表格显示区域-->
				<section class="panel">
					<!--区块头 显示表格名称和功能按钮-->
					<header class="panel-heading">
						销售回厂查询条件
						<!--控制按钮-->
						<span class="tools pull-right"> <!--收起-->
							<button type="button" class="btn btn-success pull-left" ng-click="SearchData()" 
							style="margin-left: 5px;">
								<i class="fa fa-search"></i> 查询
							</button>
							<button type="button" class="btn btn-info  pull-left" ng-click="ExportData()" 
							style="margin-left: 5px;">
								<i class="fa fa-table"></i> 导出EXCEL
							</button> <a href="javascript:;" class="fa fa-chevron-up form_display"></a>

						</span>
					</header>
					<!--区块body 显示表格内容-->
					<div class="panel-body form-horizontal form_hide">
						<div class="row">
                        	 
                        	<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">事业部</label>
										<div class="col-lg-8 col-sm-7">
										<input type="text" id="group_name" ng-keyup="clearGroup()" name="group_name"   class="form-control select_edit form_params" />
                                            <ul class="select_list">
                                                  <li ng-repeat="e in groups" ng-click='LoadBrands(e.group_name)' val_code="{{e.group_name}}" val_name="{{e.group_name}}">{{e.group_name}}</li>
                                            </ul>  
                                            </div>
								</div>
							</div>
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">店面品牌</label>
									<div class="col-lg-8 col-sm-7">
										<input type="text" id="entity_brand_name"  ng-keyup="clearGroupBrand()" name="entity_brand_name" class="form-control select_edit form_params" value=""/>
                                            <ul class="select_list">
                                                  <li ng-repeat="e in gBrands" ng-click='LoadEntitys(e)' val_code="{{e.brand_code}}" val_name="{{e.brand_name}}">{{e.brand_name}}</li>
                                            </ul> 
									</div>
								</div>
							</div>
							
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label" for="inputEmail1">店面信息</label>
									<div class="col-lg-8 col-sm-7">
											<input type="text" id="entity_name" ng-keyup="clearGroupBrandEntity()" name="entity_name" class="form-control select_edit form_params" value=""/>
                                            <ul class="select_list">
                                                  <li ng-repeat="e in entitys" ng-click='LoadEntityBrands(e)'  val_code="{{e.entity_code}}" val_name="{{e.entity_name}}">{{e.entity_name}}({{e.entity_code}})</li>
                                            </ul>  
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">维修类型</label>
									<div class="col-lg-8 col-sm-7">
									     <select name="repair_type_codes" id="repair_type_codes" multiple="multiple" class="form-control form_params">
										 </select>
									</div>
								</div>
							</div>
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">是否回厂</label>
									<div class="col-lg-8 col-sm-7">
										<select name="isbackfactory"  class="form-control form_params">
											<option></option>
											<option ng-repeat="b in isSelfSell" value="{{b.status_code}}">{{b.status_desc}}</option>
										</select>
									</div>
								</div>
							</div>
							
								<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">销售日期</label>
									<div class="col-lg-8 col-sm-7">
										<div data-date-format="yyyy-mm-dd" data-date="2016-5-15" class="input-large custom-date-range ">
											<input type="text" name="found_date1" class="form-control form_params" id="found_date1" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'found_date2\')||\'2020-10-01\'}'})">
										</div>
									</div>
								</div>
							</div>
                            
                            <div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label text-center" for="inputEmail1">至</label>
									<div class="col-lg-8 col-sm-7">
										<div data-date-format="yyyy-mm-dd" data-date="2016-5-15" class="input-large custom-date-range">
											 <input type="text" name="found_date2" class="form-control form_params" id="found_date2" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'found_date1\')}',maxDate:'2020-10-01'})">
										</div>
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">VIN</label>
									<div class="col-lg-8 col-sm-7">
										<input name="vin" type="text" class="form-control form_params">
									</div>
								</div>
							</div>
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">品牌</label>
									<div class="col-lg-8 col-sm-7">
										<select name="brand_code"  ng-model="ch_brand"  class="form-control form_params">
											<option></option>
											<option ng-selected="b.brand_code==selected.brand_code"  ng-repeat="b in brands"  value="{{b.brand_code}}">{{b.brand_name}}</option>
										</select>
									</div>
								</div>
							</div>

							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">车系</label>
									<div class="col-lg-8 col-sm-7">
										<select name="series_code" id="series_code" ng-model="$root.ch_serie" class="form-control form_params">
											<option></option>
											<option ng-selected="b.series_code==selected.intent_series_code" ng-repeat="b in $parent.series" value="{{b.series_code}}">{{b.series_name}}</option>
										</select>
									</div>
								</div>
							</div>

							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">车型</label>
									<div class="col-lg-8 col-sm-7">
										<select name="model_code" id="model_code" class="form-control form_params">
											<option></option>
											<option ng-selected="b.model_code==selected.intent_model_code" ng-repeat="b in $parent.models" value="{{b.model_code}}">{{b.model_name}}</option>
										</select>
									</div>
								</div>
							</div>
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">销售渠道</label>
									<div class="col-lg-8 col-sm-7">
										<select name="source_name"  class="form-control form_params">
											<option></option>
											<option ng-repeat="b in source_name" value="{{b.source_name}}">{{b.source_name}}</option>
										</select>
									</div>
								</div>
							</div>
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">是否首保</label>
									<div class="col-lg-8 col-sm-7">
										<select name="isfirst"  class="form-control form_params">
											<option></option>
											<option ng-repeat="b in isFirst" value="{{b.status_code}}">{{b.status_desc}}</option>
										</select>
									</div>
								</div>
							</div>
							
						</div>
					</div>
				</section>

				<section class="panel">
					<!--区块头 显示表格名称和功能按钮-->
					<header class="panel-heading">
						销售回厂报表
						<headshow></headshow>
						<div class="option_check_list" style="display: inline-block;"></div>

						<!--控制按钮-->
						<span class="tools pull-right"> <!--收起--> <a
							href="javascript:;" class="fa fa-chevron-down"></a>
						</span>
						<div class="pull-right"
							style="margin-right: 10px; margin-top: -6px; display: inline-block">
							<button type="button" class="btn btn-danger btn-sm " href="#paramsSelect"
								data-toggle="modal">
								<i class="fa fa-plus"></i> 在结果集中筛选
							</button>
							<button type="button" class="btn btn-success btn-sm"
								id="search_table" ng-click="SearchData();">
								<i class="fa fa-search"></i> 查询表格
							</button>
						</div>
					</header>
					<!--区块body 显示表格内容-->
					<div class="panel-body form-horizontal ">

						<div class="adv-table" style="overflow-x: scroll">
							<table id="salesReturnTable"
								class="table table-striped  nowrap  dataTable no-footer table_store table-hover float_head"
								cellspacing="0" width="100%">
								<thead>
									<tr>
										<th ng-show="!cols.contains('index')" column="index">序号</th>
										<th ng-show="!cols.contains('entity_code')" column="entity_code">店面编号</th>
										<th ng-show="!cols.contains('entity_name')" column="entity_name">店面名称</th>
										<th ng-show="!cols.contains('entity_brand_name')" column="entity_brand_name">店面品牌</th>
										<th ng-show="!cols.contains('group_name')" column="group_name">事业部</th>
										<th ng-show="!cols.contains('license')" column="license">车牌号</th>
										<th ng-show="!cols.contains('vin')" column="vin">VIN</th>
										<th qtype='date' ng-show="!cols.contains('salesdate')" column="salesdate">销售日期</th>
										<th qtype='bool' ng-show="!cols.contains('isbackfactory')" column="isbackfactory">回厂标志</th>
										<th qtype='date' ng-show="!cols.contains('firstindate')" column="firstindate">回厂日期</th>
										<th qtype='float'ng-show="!cols.contains('lastmaintainmileage')" column="lastmaintainmileage">上次维修里程</th>
										<th qtype='date' ng-show="!cols.contains('lastmaintaindate')" column="lastmaintaindate">上次维修日期</th>
										<th ng-show="!cols.contains('ownerno')" column="ownerno">车主编号</th>
										<th ng-show="!cols.contains('ownername')" column="ownername">车主</th>
										<th ng-show="!cols.contains('brand_name')" column="brand_name">品牌</th>
										<th ng-show="!cols.contains('series_name')" column="series_name">车系</th>
										<th ng-show="!cols.contains('model_name')" column="model_name">车型</th>
										<th ng-show="!cols.contains('source_name')" column="source_name">销售渠道</th>
										<th qtype='bool' ng-show="!cols.contains('isfirst')" column="isfirst">是否首保</th>
										<th ng-show="!cols.contains('phone')" column="phone">电话</th>
										<th ng-show="!cols.contains('mobile')" column="mobile">手机</th>
										<th ng-show="!cols.contains('address')" column="address">地址</th>
										<th ng-show="!cols.contains('contactorname')" column="contactorname">联系人</th>
										<th ng-show="!cols.contains('contactorphone')" column="contactorphone">联系人电话</th>
										<th ng-show="!cols.contains('contactormobile')" column="contactormobile">联系人手机</th>
										<th ng-show="!cols.contains('deliverer')" column="deliverer">送修人</th>
										<th ng-show="!cols.contains('delivererphone')" column="delivererphone">送修人电话</th>
										<th ng-show="!cols.contains('deliverermobile')" column="deliverermobile">送修人手机</th>
										<th ng-show="!cols.contains('delivereraddress')" column="delivereraddress">送修人地址</th>
									</tr>
								</thead>
								<tbody>
									<tr ng-repeat="c in salesReturnReports" >
										<td ng-show="!cols.contains('index')" class="">{{$index + 1 }}</td>
										<td ng-show="!cols.contains('entity_code')" class="">{{c.entity_code}}</td>
										<td ng-show="!cols.contains('entity_name')" class="">{{c.entity_name}}</td>
										<td ng-show="!cols.contains('group_brand_name')" class="">{{c.entity_brand_name}}</td>
										<td ng-show="!cols.contains('group_name')" class="">{{c.group_name}}</td>
										<td ng-show="!cols.contains('license')" class="">{{c.license}}</td>
										<td ng-show="!cols.contains('vin')" class="">{{c.vin}}</td>
										<td ng-show="!cols.contains('salesdate')" class="">{{c.salesdate | date:'yyyy-MM-dd'}}</td>
										<td ng-show="!cols.contains('isbackfactory')" class="">{{c.isbackfactory == null?"":(c.isbackfactory=='12781001'?'是':'否')}}</td>
										<td ng-show="!cols.contains('firstindate')" class="">{{c.firstindate | date : 'yyyy-MM-dd'}}</td>
										<td ng-show="!cols.contains('lastmaintainmileage')" class="">{{c.lastmaintainmileage}}</td>
										<td ng-show="!cols.contains('lastmaintaindate')" class="">{{c.lastmaintaindate | date : 'yyyy-MM-dd'}}</td>
										<td ng-show="!cols.contains('ownerno')" class="">{{c.ownerno}}</td>
										<td ng-show="!cols.contains('ownername')" class="">{{c.ownername}}</td>
										<td ng-show="!cols.contains('brand_name')" class="">{{c.brand_name}}</td>
										<td ng-show="!cols.contains('series_name')" class="">{{c.series_name}}</td>
										<td ng-show="!cols.contains('model_name')" class="">{{c.model_name}}</td>
										<td ng-show="!cols.contains('source_name')" class="">{{c.source_name}}</td>
										<td ng-show="!cols.contains('isfirst')" class="">{{c.isfirst == null?"":(c.isfirst=='12781001'?'是':'否')}}</td>
										<td ng-show="!cols.contains('phone')" class="">{{c.phone | mobile}}</td>
										<td ng-show="!cols.contains('mobile')" class="">{{c.mobile | mobile}}</td>
										<td ng-show="!cols.contains('address')" class="">{{c.address}}</td>
										<td ng-show="!cols.contains('contactorname')" class="">{{c.contactorname}}</td>
										<td ng-show="!cols.contains('contactorphone')" class="">{{c.contactorphone | mobile}}</td>
										<td ng-show="!cols.contains('contactormobile')" class="">{{c.contactormobile | mobile}}</td>
										<td ng-show="!cols.contains('deliverer')" class="">{{c.deliverer}}</td>
										<td ng-show="!cols.contains('delivererphone')" class="">{{c.delivererphone | mobile}}</td>
										<td ng-show="!cols.contains('deliverermobile')" class="">{{c.deliverermobile | mobile}}</td>
										<td ng-show="!cols.contains('delivereraddress')" class="">{{c.delivereraddress}}</td>
									</tr>

								</tbody>
							</table>
							<div class="no-items" ng-show="pagination.totalItems <= 0">暂无数据</div>
						</div>
						<tm-pagination conf="pagination"></tm-pagination>
					</div>
				</section>
				<!--表格显示区域-->

			</div>
		</div>
	</div>
</div>

<form id="export_form" action="salesReturn/export"  method="post">
	<input type="hidden" name="keys" id="keys" />
	<input type="hidden" name="names" id="names" /> 
	<input type="hidden" name="params" id="params" />
	<input type="hidden" name="search_opt" id="search_opt" /> 
	<input type="hidden" name="file_name" id="file_name" value="销售回厂查询"/>
</form>



